package com.bzoa.api.control;


import com.bzoa.api.dto.MenuDTO;
import com.bzoa.api.service.MenuService;
import com.springboot.common.entity.ResponseResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;


/**
 * @Author lands
 * @Date 2023/3/6 10:32
 * @Description  菜单接口
 */
@RestController
@RequestMapping("menu")
public class MenuController {
    @Autowired
    private MenuService menuService;
    @GetMapping("getMenuList")
    public ResponseResult getMenuList(){
        List<MenuDTO> menuList = menuService.listProduct();

        if(menuList==null){
            return  ResponseResult.error("你没有任何权限可以访问列表");
        }else{
            return  ResponseResult.ok(menuList);
        }
    }
}

